﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Data.SqlClient;
using System.Resources;
using System.Globalization;

namespace atm_qlda
{
    public partial class Choose : Form
    {

        CultureInfo culture;
        string id;
        string language;
        public Choose()
        {
            InitializeComponent();
        }

        private void Choose_Load(object sender, EventArgs e)
        {

        }

        public delegate void delegateSend(string id, string language);


        public void SetLanguage(string cultureName)
        {

            culture = CultureInfo.CreateSpecificCulture(cultureName);
            ResourceManager rm = new ResourceManager("atm_qlda.Lang.MyResource", typeof(Choose).Assembly);
            lbheaderut.Text = rm.GetString("bank", culture);
            lbChoose.Text = rm.GetString("choose", culture);
            lbrut.Text = rm.GetString("chooserut", culture);
            lbgui.Text = rm.GetString("choosegui", culture);
            lbchuyen.Text = rm.GetString("choosetrans", culture);
            lbabout.Text = rm.GetString("chooseabout", culture);
            lbdoipass.Text = rm.GetString("choosepass", culture);
            lbvantin.Text = rm.GetString("choosevt", culture);
        }

        private void bttAbout_Click(object sender, EventArgs e)
        {
            AboutBox1 a = new AboutBox1();
            a.Show();
            this.Hide();
        }

        private void bttRut_Click_1(object sender, EventArgs e)
        {
            Withdraw rt = new Withdraw();
            delegateSend dele = new delegateSend(rt.chuyendl2);
            dele(this.id,this.language);
            rt.Show();
            rt.SetLanguage(language);
            this.Hide();
        }

        private void bttpass_Click(object sender, EventArgs e)
        {
            changePass cp = new changePass();
            delegateSend dele = new delegateSend(cp.sendl);
            dele(this.id, this.language);
            cp.Show();
            cp.SetLanguage(language);
            this.Hide();
        }

        public void chuyendl(string chuoi, string lag)
        {
            this.id = chuoi;
            this.language = lag;
        }

        private void bttgui_Click(object sender, EventArgs e)
        {
            frmDeposit dp = new frmDeposit();
            delegateSend dele = new delegateSend(dp.sendl);
            dele(this.id, this.language);
            dp.Show();
            dp.SetLanguage(language);
            this.Hide();
        }

        private void bttchuyen_Click(object sender, EventArgs e)
        {
            string sodu = label1.Text;
            Chuyentien f = new Chuyentien(sodu);
            f.Show();
            this.Hide();
        }
       }
}
